package 非线性结构.树.bean;

public class Person implements Comparable<Person> {
    public String name;
    public int age;

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Person(int age) {
        this.age = age;
    }

    @Override
    protected void finalize() throws Throwable {
        super.finalize();

        System.out.println("Person finalize name:" + name);
    }

    @Override
    public String toString() {
        return "age=" + age;
    }

    @Override
    public int compareTo(Person o) {
        return age - o.age;
    }
}
